Conversation
| AND e_subsequent.voided = 0 | ||
| AND et_subsequent.uuid = 'cb0a65a7-0587-477e-89b9-cf2fd144f1d4' | ||
| AND DATE(e_subsequent.encounter_datetime) > DATE(o_appt.value_datetime) | ||
| AND DATE(e_subsequent.encounter_datetime) <= :onOrBefore |
There was a problem hiding this comment.
Ensure they received drugs
There was a problem hiding this comment.
Add logic that queries patients seen in the reporting period who were given drugs
| List<Concept> artInitiationAnswers = new ArrayList<Concept>(); | ||
| artInitiationAnswers.add(cs.getConceptByUuid("1256AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); // Start ART | ||
| artInitiationAnswers.add(cs.getConceptByUuid("162904AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); // Restart ART | ||
| artInitiation.setValueList(artInitiationAnswers); |
There was a problem hiding this comment.
Ensure they have drugs given
| List<Concept> transferInPMTCTAnswers = new ArrayList<Concept>(); | ||
| transferInPMTCTAnswers.add(cs.getConceptByUuid("160563AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); // Transfer in | ||
| transferInPMTCTAnswers.add(cs.getConceptByUuid("163532AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); // Enroll into PMTCT | ||
| transferInPMTCT.setValueList(transferInPMTCTAnswers); |
There was a problem hiding this comment.
Ensure they have drugs given
| WHERE o_prevention.encounter_id = o.encounter_id | ||
| AND o_prevention.voided = 0 | ||
| AND c_prevention.uuid = '163532AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' -- ART Prevention being taken | ||
| AND o_prevention.value_coded IS NOT NULL |
There was a problem hiding this comment.
This answer should be "Yes"
ibacher
left a comment
There was a problem hiding this comment.
Thanks @reagan-meant! A few questions, but mostly small quibbles about SQL...
| import org.openmrs.module.reporting.common.BooleanOperator; | ||
|
|
||
| @Component | ||
| public class DRCTx_CurrReportManager extends ActivatedReportManager { |
There was a problem hiding this comment.
I think we probably just name this DRCTxCurrReportManager?
| AND o.value_numeric IS NOT NULL | ||
| AND o.value_numeric < 90 |
There was a problem hiding this comment.
Technically o.value_numeric < 90 will also eliminate rows where value_numeric is null
There was a problem hiding this comment.
SQL uses a 3-value logic where things are TRUE, FALSE and NULL that uses something like these truth tables:
| Value | NOT Value |
|---|---|
| True | False |
| False | True |
| Null | Null |
| Value | AND True | AND False | AND Null |
|---|---|---|---|
| True | True | False | Null |
| False | False | False | Null |
| Null | Null | Null | Null |
| Value | OR True | OR False | OR Null |
|---|---|---|---|
| True | True | True | Null |
| False | True | False | Null |
| Null | Null | Null | Null |
Basically, any operation that involves a NULL results in a NULL, and NULL is not true, so the row isn't matched.
| AND o.value_numeric IS NOT NULL | ||
| AND o.value_numeric > 180 |
| AND DATE(o.obs_datetime) >= :onOrAfter | ||
| AND DATE(o.obs_datetime) <= :onOrBefore |
There was a problem hiding this comment.
| AND DATE(o.obs_datetime) >= :onOrAfter | |
| AND DATE(o.obs_datetime) <= :onOrBefore | |
| AND DATE(o.obs_datetime) BETWEEN :onOrAfter AND :onOrBefore | |
| // Not stopped ART in date range | ||
| SqlCohortDefinition notStoppedARTSqlCD = new SqlCohortDefinition(); | ||
| String notStoppedARTSql = getStringFromResource("org/openmrs/module/drcreports/sql/DRCTxCurrNotStopedART.sql"); | ||
| notStoppedARTSqlCD.setQuery(notStoppedARTSql); | ||
| notStoppedARTSqlCD.addParameter(new Parameter("onOrAfter", "On Or After", Date.class)); | ||
| notStoppedARTSqlCD.addParameter(new Parameter("onOrBefore", "On Or Before", Date.class)); |
There was a problem hiding this comment.
Does this account for the case where in one quarter, a person initiates ART, discontinues ART and then recontinues it before the end date?
| notTransferredOutSqlCD.addParameter(new Parameter("onOrAfter", "On Or After", Date.class)); | ||
| notTransferredOutSqlCD.addParameter(new Parameter("onOrBefore", "On Or Before", Date.class)); | ||
|
|
||
| // Lessthan 3 months ART Dispensation |
There was a problem hiding this comment.
| // Lessthan 3 months ART Dispensation | |
| // Less than 3 months ART Dispensation |
There was a problem hiding this comment.
DRCTxCurrNotStoppedART.sql 👉 DRCTxCurrNotStoppedART.sql
api/src/main/resources/org/openmrs/module/drcreports/sql/DRCTxCurrTransferPMTCT.sql
Show resolved
Hide resolved
|
Could we add some test cases for this since it's kind of key we get this right. I think the tests should cover:
|
| ${project.parent.artifactId}.report.drc.fifteenYrsAndAboveMales.label=15+ years (Males) | ||
| ${project.parent.artifactId}.report.drc.fifteenYrsAndAboveFemales.label=15+ years (Females) | ||
|
|
||
| ${project.parent.artifactId}.report.drc.threeMonthsDrugsGiven.label=3 months drugs |
There was a problem hiding this comment.
Could we change the label here to "3 months or less" and similarly in French.
There was a problem hiding this comment.
It is actually less than 3 months, fixed.
There was a problem hiding this comment.
Two minor things:
- Could we name this simlarly to the report manager itself, i.e.,
DRCTxCurrTestDataset - Why is the dataset split into two?
|
Hmmm... It seems the test fails now? |
No description provided.